var proxy=require('http-proxy').createProxyServer({});

proxy.on(function(err,req,res){
console.log(host);
res.writeHead(500,{

'Content-Type':'text/plain'

});

});

var server=require('http').createServer(function(req,res){

var host= req.headers.host;
// console.log(req.originalUrl);
switch(host){

case 'www.zspen.com:8088':
proxy.web(req,res,{target:'http://localhost:3000'});

break;

default: 

res.writeHead(200, { 

'Content-Type': 'text/plain' 

}); 

res.end('Welcome to Zspen!');

}

});

console.log("listening on port 80")

server.listen(8088);